<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <style>
    .active {
        border: 3px solid blue;
        width: 100px;
        height: 100px;
    }
    .error {
        background-color: red;
    }

    </style>

</head>
<body>
<div id="app">
    <div :class="{active : isActive, error : isError}">绑定 Class</div>
    <div :style="styleObj">绑定 Style</div>
</div>


<script>
    let app = new Vue({
        el: '#app',
        data: {
            isActive: true,
            isError: true,
            styleObj: {
                border: '2px solid green',
                width: '150px',
                height: '150px'
            }
        }
    })

</script>

</body>
</html>
